package com.gt.web.controller.app;

import com.gt.app.domain.dto.ColonProjectDto;
import com.gt.app.domain.dto.EsColonScreenProjectDto;
import com.gt.app.domain.dto.EsScreenProjectDto;
import com.gt.app.domain.vo.ColonScreenProjectVo;
import com.gt.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.*;
import com.gt.app.service.EsColonScreenProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 * 结肠癌筛查项目 前端控制器
 * </p>
 *
 * @author caidesheng
 */
@Slf4j
@RestController
@RequestMapping("esColonScreenProject")
@Api(tags = "结肠癌筛查项目接口")
public class EsColonScreenProjectController {

    @Autowired
    private EsColonScreenProjectService  esColonScreenProjectService;

    @ApiOperation(value = "获取结肠癌筛查项目")
    @GetMapping(value = "getColonScreenProject")
    public AjaxResult getColonScreenProject(String checkId) {
        List<ColonScreenProjectVo> esColonScreenProjects = esColonScreenProjectService.getColonScreenProject(checkId);
        return AjaxResult.success(esColonScreenProjects);
    }

    @ApiOperation(value = "填写结肠癌筛查项目")
    @PostMapping(value = "addColonScreenProjectUser")
    public AjaxResult addColonScreenProjectUser(@RequestBody ColonProjectDto colonProjectDto) {
        esColonScreenProjectService.addColonScreenProjectUser(colonProjectDto);
        return AjaxResult.success();
    }
}
